package city.spring.modules.material.repository;

import city.spring.modules.material.entity.MaterialwarehousingEntity;
import city.spring.modules.material.vo.MaterialwarehousingVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：入库信息
 *
 * @author 谢金婷
 * @date 2020-04-08 12:05:00
 */
@Repository
public interface MaterialwarehousingRepository extends BaseMapper<MaterialwarehousingEntity> {

    /**
     * 根据id获取入库信息
     *
     * @param id
     * @return
     */
    MaterialwarehousingEntity getById(String id);

    IPage<MaterialwarehousingVO> listPage(Page<? extends MaterialwarehousingEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialwarehousingEntity> wrapper);

    /**
     * 入库单作废
     *
     * @param id
     * @param entity
     */
    void checkCancellation(String id, MaterialwarehousingEntity entity);
}